import { app, Tray, Menu, nativeImage } from "electron";
import path from "node:path";

app.setAppUserModelId('syt工具箱')

const icon = nativeImage.createFromPath(
  path.join(__dirname, "./images/tuBiao.png")
);

export let tray: Tray = null

export function createTray() {
  tray = new Tray(icon);
  const contextMenu = Menu.buildFromTemplate([
    {
      label: "退出SYT工具箱",
      type: "normal",
      click: () => {
        app.quit();
      },
    },
  ]);
  tray.setContextMenu(contextMenu);
  tray.setToolTip('SYT工具箱')
}
